<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	  xmlns:fs="http://www.wueasy.com">
<head>
	<head th:include="layout :: header" th:remove="tag"/>
	<div th:include="layout :: frame" th:remove="tag"/>
</head>
<body>
<div class="layui-fluid">
  	  	<div class="layui-card">
    		<div class="layui-card-body">
    			<div class="layui-form-query" style="display: none;">
    			<form class="layui-form" id="query_form">
					<div class="layui-form-item">
						<input type="hidden" id="serverIp" name="serverIp" autocomplete="off" class="layui-input"/>
					</div>
				</form>
				</div>
				<div>
					<button class="layui-btn" function="refresh">
					  <i class="layui-icon layui-icon-refresh-1"></i>刷新
					</button>
		    	</div>
				<table id="fsDatagrid" class="fsDatagrid" lay-filter="fsDatagrid" fs:authorize="" funcNo="S1087" isPage="0" defaultForm="query_form" height="full-90">
				</table>
				
				<div class="fsDatagridCols">
					<p type="numbers" title="#"/>
				    <p field="jobName" title="作业名称" width="230"/>
				    <p field="instanceCount" title="运行实例数" width="200"/>
				    <p field="status" title="状态" width="200" templet="#statusTpl"/>
				     <p fixed="right" align="center" toolbar="#barDemo" title="操作" width="160"/>
				</div>
				<script type="text/html" id="statusTpl">
  					{{#  if(d.instanceCount == 0){ }}
   						<span class="layui-badge layui-bg-gray">已下线</span>
 					{{#  } else if(d.status == 'OK') { }}
   						<span class="layui-badge layui-bg-green">正常</span>
 					{{#  } else if(d.status == 'DISABLED') { }}
   						<span class="layui-badge layui-bg-orange">已失效</span>
					{{#  } else if(d.status == 'SHARDING_FLAG') { }}
   						<span class="layui-badge layui-bg-blue">分片待调整</span>
 					{{#  } else if(d.status == 'CRASHED') { }}
   						<span class="layui-badge layui-bg-gray">已下线</span>
 					{{#  } }}
				</script>
				<script type="text/html" id="barDemo">
 				 {{#  if(d.instanceCount == 0){ }}
					 <a id="del" class="layui-btn layui-btn-danger layui-btn-xs" fs:authorize="" lay-event="submit" isConfirm="1" funcNo="S1091" inputs="serverIp:#serverIp,jobName:">删除</a>
 				 {{#  } else if(d.status == 'DISABLED') { }}
					 <a id="qy" class="layui-btn layui-bg-green layui-btn-xs" fs:authorize="" lay-event="submit" isConfirm="1" funcNo="S1089" inputs="serverIp:#serverIp,jobName:">生效</a>
              	     <a id="zz" class="layui-btn layui-btn-danger layui-btn-xs" fs:authorize="" lay-event="submit" isConfirm="1" funcNo="S1090" inputs="serverIp:#serverIp,jobName:">终止</a>
				 {{#  } else { }}
					 <a id="sx" class="layui-btn layui-bg-orange layui-btn-xs" fs:authorize="" lay-event="submit" isConfirm="1" funcNo="S1088" inputs="serverIp:#serverIp,jobName:">失效</a>
					 <a id="zz" class="layui-btn layui-btn-danger layui-btn-xs" fs:authorize="" lay-event="submit" isConfirm="1" funcNo="S1090" inputs="serverIp:#serverIp,jobName:">终止</a>
 				 {{#  } }}

				</script>
    		</div>
    	</div>
</div>
</body>
</html>